package com.gxa.modules.mapper;

import com.gxa.modules.pojo.Waybill;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @Auth WK
 * @DATE 2022/9/14 2:27
 * @DESCRIBE
 */
@Repository
public interface WaybillMapper {

    /**
     * 1.运单列表查询
     * @param start
     * @param off
     * @param status_way4
     * @return
     */
    List<Map> findWaybillList(@Param("start") Integer start, @Param("off") Integer off, @Param("status_way4") Integer status_way4);
    int findCountOfWaybill(@Param("status_way4") Integer status_way4);

    /**
     * 2.新增运单
     * @param waybill
     * @return
     */
    int addWaybill(Waybill waybill);

    /**
     * 3.运单配载
     * @param waybillId
     * @param status_way2
     * @return
     */
    int stowageWaybill(@Param("waybillId")Integer waybillId, @Param("status_way2")Integer status_way2);

    /**
     * 4.运单确认到达
     * @param waybillId
     * @return
     */
    int updateWaybill(@Param("waybillId") Integer waybillId, @Param("status_way3") Integer status_way3);

    /**
     * 5.查看运单详情
     * @param waybillId
     * @return
     */
    Map findWaybill(@Param("waybillId") Integer waybillId);

    /**
     * 6.删除运单
     * @param waybillId
     * @param status_way4
     * @return
     */
    int delectWaybill(@Param("waybillId") Integer waybillId, @Param("status_way4") Integer status_way4);

    /**
     * 7.条件搜索运单
     * @param waybillNumber
     * @param customerName
     * @param payTime
     * @param currentPage
     * @param pageSize
     * @param status_way4
     * @return
     */
    List<Map> findWaybillByCondition(@Param("waybillNumber") String waybillNumber, @Param("customerName") String customerName, @Param("payTime") String payTime, @Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize, @Param("status_way4") Integer status_way4);

    int findCountOfWaybillByCondition(@Param("status_way4") Integer status_way4);

    /**
     * 8.运单查询（待配载)
     * @param start
     * @param off
     * @param status_way1
     * @return
     */
    List<Map> findWaybillByStowage1(@Param("start") Integer start, @Param("off") Integer off, @Param("status_way1") Integer status_way1);

    int findCountOfWaybillByStowage1(@Param("status_way1") Integer status_way1);

    /**
     * 9.运单查询（已配载）
     * @param start
     * @param off
     * @param status_way2
     * @return
     */
    List<Map> findWaybillByStowage2(@Param("start") Integer start, @Param("off") Integer off, @Param("status_way2") Integer status_way2);

    int findCountOfWaybillByStowage2(@Param("status_way2") Integer status_way2);

    /**
     * 10.运单查询（已完成）
     * @param start
     * @param off
     * @param status_way3
     * @return
     */
    List<Map> findWaybillByStowage3(@Param("start") Integer start, @Param("off") Integer off, @Param("status_way3") Integer status_way3);

    int findCountOfWaybillByStowage3(@Param("status_way3") Integer status_way3);

    /**
     * 11.批量删除运单
     * @param waybillId
     * @param status_way4
     */
    void delectWaybillList(@Param("waybillId") Integer waybillId, @Param("status_way4") Integer status_way4);


}
